// 云闪推——开头/片尾库-
import request from '@/utils/request';
import {object2Url} from "@/utils/trans";


// 新增片头片尾  修改片头片尾 id区分
export async function addTrailer (data) {
  const res = await request.post('/business/titlesTrailer/add', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 根据id查询片头片尾
export async function getTrailerInfo (data) {
  const res = await request.post('/business/titlesTrailer/pageList', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 片头片尾_非分页查询
export async function queryTrailer (data) {
  const res = await request.post('/business/titlesTrailer/page', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 删除——片头片尾
export async function delTrailer (data) {
  const res = await request.post('/business/titlesTrailer/delete', data)
  if (res.data.code === 2000) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


